#!/bin/bash


identifierList=("0887cb5b-b443-4e08-a169-038208109466" \
                "3ae12661-de07-4ca7-af86-7af4033e9cf7" \
                "54fe3ea3-a47c-4784-b3d2-0ce1be5302b9" \
                "cb871fc7-ac82-4eac-9512-e1bae187947e" \
                "36797585-c8f8-4880-b782-ee899f903476" \
                "0d925ae5-d8ca-46b4-a27c-1e03036eb040" \
                "deba2b08-fd4c-42fb-bb21-51a3ebf78be7" \
                "264fc501-2b87-4a33-9b74-269149f3afc5" \
                "8422b6d0-e3f3-4b5a-9538-bc490fdfadb0" \
                "4a12a8c0-c573-11dc-b99b-00008a07204e" \
                "15258abc-8583-425b-ae97-85fef558ba3b" \
                "35446fc0-4af6-11dc-b9a3-00008a07204e" \
                "a5a02dc8-16b4-4b50-abad-af4a1c1e9c49" \
                "dbd375b2-5422-49a1-a874-0ee8386b9505" \
                "a581c961-8632-497f-bc5e-2002957577ec" \
                "a0b44257-1652-4f4e-ae46-7a3fe20ef839" \
                "cbd643be-9358-4a93-9279-7412b6e70b2f" \
                "615b2600-197e-4c3b-9c46-a88b00729ff7" \
                "baf18fb4-60e2-44d6-acb3-0583120f5b87" \
                "028772fc-f6bf-445f-a28e-96a0cfed6eb0" \
                "cc7435d1-edcb-492a-b511-1934c7131d99" \
                "180f4bbf-7ffd-4ac1-a838-0aedbb175477" \
                "5a332a2e-daec-4a09-a797-9482aa5b6c28" \
                "3ca4e966-f6d6-4d9a-9389-362d1842f137" \
                "ddd5d5fd-cea5-4436-9886-4895e8ef6f1b" \
                "36573c3b-ab30-41b9-ad23-cc9eafb4e525" \
                "e93648ea-4f04-4c74-8501-da7fde21f703" \
                "8db8172d-c405-4012-97ea-5a7faef7e9c7" \
                "35dae16b-cbe8-40ee-800e-94ea0e7bff59" \
                "ac85d9db-1c11-48c9-8ff2-fd5fcc347a74" \
                "85352b6d-9d9a-4330-9fe5-93b9258a331c" \
                "727322f6-b34a-4df6-9cb3-61b418e37fd8" \
                "727322f6-b34a-4df6-9cb3-61b418e37fd8" )

    rm ForAIMS/AIMSRegistryObjects.xml
    
    for i in ${!identifierList[*]}
    do
        uri="http://data.aims.gov.au/geonetwork/srv/en/oaipmh?verb=GetRecord&identifier=${identifierList[$i]}&metadataPrefix=iso19139.mcp-1.4" 
        printf "$uri\n" 

        echo wget --header='Accept-Language: en-us' $uri -O ${identifierList[$i]}_wget.xml
        wget --header='Accept-Language: en-us' $uri -O ${identifierList[$i]}_wget.xml
        
        echo "Moving on..."

        echo "java -jar /home/anucsiro/workspace/XML/XSLT/saxon9he.jar ${identifierList[$i]}_wget.xml /home/anucsiro/workspace/XML/XSLT/ISO19139_To_RIFCS/AIMS/AIMS_rif.xsl > ForAIMS/${identifierList[$i]}_rif-cs.xml"

        java -jar /home/anucsiro/workspace/XML/XSLT/saxon9he.jar ${identifierList[$i]}_wget.xml /home/anucsiro/workspace/XML/XSLT/ISO19139_To_RIFCS/AIMS/AIMS_rif.xsl > ForAIMS/${identifierList[$i]}_rif-cs.xml

        cat ForAIMS/${identifierList[$i]}_rif-cs.xml >> ForAIMS/AIMSRegistryObjects.xml

    done




   
